Skip to content

fix(#5465): discover mint URL from org variable for per-org repos#5469

Merged
ggallen merged 1 commit into
mainfrom
agent/5465-init-mint-url-org-var
Jul 24, 2026
Merged

fix(#5465): discover mint URL from org variable for per-org repos#5469
ggallen merged 1 commit into
mainfrom
agent/5465-init-mint-url-org-var

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Summary

fullsend repos init fails to discover the mint URL for per-org installations when orgCfg.DispatchSettings().MintURL is empty. This adds a fallback to check the org-level GitHub Actions variable FULLSEND_MINT_URL (set during fullsend admin install).

Related Issue

Fixes #5465

Changes

  • Add org-level variable fallback in discoverRepo() (internal/repos/init.go): after checking orgCfg.DispatchSettings().MintURL, fall back to client.GetOrgVariable(ctx, owner, "FULLSEND_MINT_URL") when the mint URL is still empty
  • Org config remains the primary source; the variable is best-effort
  • GetOrgVariable errors are logged as warnings, not fatal
  • Add three test cases covering: fallback discovery, org config precedence, and error handling

Testing

  • All existing internal/repos tests pass
  • Three new tests added:
    • TestDiscoverRepo_PerOrg_OrgVarFallback — verifies mint URL is discovered from org variable when org config has no mint_url
    • TestDiscoverRepo_PerOrg_OrgConfigTakesPrecedence — verifies org config mint_url wins over org variable
    • TestDiscoverRepo_PerOrg_OrgVarError_NonFatal — verifies GetOrgVariable errors produce a warning, not a failure
  • go vet passes

Checklist

  • PR title follows Conventional Commits (correct type, ! for breaking changes)
  • Commits are signed off (DCO) — human and human-directed agent sessions only
  • I wrote this contribution myself and can explain all changes in it

Closes #5465

Post-script verification

  • Branch is not main/master (agent/5465-init-mint-url-org-var)
  • Secret scan passed (gitleaks — 8b2146e80c0c8d8dc54fa6fa2b4f5957fc48e602..HEAD)
  • PR body secret scan passed (gitleaks — no-git)
  • Pre-commit hooks passed (authoritative run on runner)
  • Tests ran inside sandbox

@fullsend-ai-coder
fullsend-ai-coder Bot requested a review from a team as a code owner July 22, 2026 15:39
@fullsend-ai-coder fullsend-ai-coder Bot added the ready-for-review Agent PR ready for human review label Jul 22, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Jul 22, 2026

Copy link
Copy Markdown

🤖 Review · ❌ Terminated · Started 3:40 PM UTC · Ended 4:03 PM UTC
Commit: bf2d784 · View workflow run →

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown

Site preview

Preview: https://f2f1e40f-site.fullsend-ai.workers.dev

Commit: 1bbc5211de1cc53cddf1c1035e3077d08561cb4b

@fullsend-ai-review

Copy link
Copy Markdown

🤖 Finished Review · ❌ Failure · Started 3:40 PM UTC · Completed 4:03 PM UTC
Commit: bf2d784 · View workflow run →

@ggallen

ggallen commented Jul 22, 2026

Copy link
Copy Markdown
Member

/fs-review

@fullsend-ai-review

fullsend-ai-review Bot commented Jul 22, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 4:09 PM UTC · Completed 4:23 PM UTC
Commit: 7ada4e0 · View workflow run →

@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

Medium

  • [missing-documentation] docs/plans/repos-init.md:169 — The repos init plan documents per-org discovery as "Use mint URL and config from per-org config.yaml" but does not mention the new fallback to the org-level FULLSEND_MINT_URL variable when orgCfg.DispatchSettings().MintURL is empty.
    Remediation: Add a bullet noting the org variable fallback: "If no mint URL is set in config.yaml, fall back to reading the FULLSEND_MINT_URL org-level variable via GetOrgVariable."

Low

  • [error-handling-idiom] internal/repos/init.go:370 — The error handling uses an else if err != nil chain with a compound condition declaring three variables inline, which differs from the separate-declaration pattern used for GetOrgVariable calls elsewhere. The current code is functionally correct — minor style nit.

  • [missing-documentation] docs/cli/repos.md:52 — The repos init Discovery section lists three high-level checks but omits the org-level variable fallback for FULLSEND_MINT_URL. Low priority given the section's abstraction level.


Labels: PR modifies internal/repos/ (repos init command — part of the install workflow)

@fullsend-ai-review fullsend-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the review comment for full details.

Comment thread internal/repos/init.go
@fullsend-ai-review fullsend-ai-review Bot added requires-manual-review Review requires human judgment component/install CLI install and app setup labels Jul 22, 2026
@ggallen

ggallen commented Jul 22, 2026

Copy link
Copy Markdown
Member

/fs-fix. Rebase and fix all the review issues, both inline and in the sticky comment. Make sure to resolve all the conversations.

@ggallen

ggallen commented Jul 22, 2026

Copy link
Copy Markdown
Member

/fs-fix - Rebase and fix all the review issues, both inline and in the sticky comment. Make sure to resolve all the conversations.

@fullsend-ai-coder

fullsend-ai-coder Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 4:50 PM UTC · Completed 4:56 PM UTC
Commit: 7ada4e0 · View workflow run →

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 Fix agent — iteration 1 (human-triggered)

Addressed all 3 review findings: refactored error handling idiom to match codebase convention, and added org variable fallback documentation to both the repos init plan and CLI docs.

Fixed (3):

  1. error-handling-idiom: GetOrgVariable compound condition differs from separate-declaration pattern (internal/repos/init.go): Refactored the GetOrgVariable call in discoverRepo to use separate variable declaration and sequential error/exists checks, matching the idiom used in internal/cli/foreign.go and internal/mintcore/github.go
  2. missing-documentation: repos init plan omits org variable fallback (docs/plans/repos-init.md): Added a note to the per-org discovery bullet explaining the FULLSEND_MINT_URL org-level variable fallback when config.yaml has no mint URL
  3. missing-documentation: repos init CLI docs omit org variable fallback (docs/cli/repos.md): Added org variable fallback detail to the per-org config enrollment item in the Discovery section

Tests: passed

Updated by fullsend fix agent

fullsend-ai-coder Bot added a commit that referenced this pull request Jul 22, 2026
- Refactor GetOrgVariable error handling in discoverRepo to use
  separate declaration and error checks, matching the idiom used
  elsewhere in the codebase (internal/cli/foreign.go, etc.)
- Document org variable fallback in docs/plans/repos-init.md
- Document org variable fallback in docs/cli/repos.md discovery section

Addresses review feedback on #5469
@ggallen
ggallen added this pull request to the merge queue Jul 24, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 24, 2026
@ggallen
ggallen added this pull request to the merge queue Jul 24, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 24, 2026
ggallen pushed a commit that referenced this pull request Jul 24, 2026
- Refactor GetOrgVariable error handling in discoverRepo to use
  separate declaration and error checks, matching the idiom used
  elsewhere in the codebase (internal/cli/foreign.go, etc.)
- Document org variable fallback in docs/plans/repos-init.md
- Document org variable fallback in docs/cli/repos.md discovery section

Addresses review feedback on #5469
@ggallen
ggallen force-pushed the agent/5465-init-mint-url-org-var branch from cbee534 to 3b4682f Compare July 24, 2026 17:08
@ggallen
ggallen enabled auto-merge July 24, 2026 17:16
ggallen pushed a commit that referenced this pull request Jul 24, 2026
- Refactor GetOrgVariable error handling in discoverRepo to use
  separate declaration and error checks, matching the idiom used
  elsewhere in the codebase (internal/cli/foreign.go, etc.)
- Document org variable fallback in docs/plans/repos-init.md
- Document org variable fallback in docs/cli/repos.md discovery section

Addresses review feedback on #5469
@ggallen
ggallen force-pushed the agent/5465-init-mint-url-org-var branch from 3b4682f to 53c7069 Compare July 24, 2026 17:26
@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Signed-off-by: Greg Allen <greg@fullsend.ai>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Greg Allen <gallen@redhat.com>
@ggallen
ggallen force-pushed the agent/5465-init-mint-url-org-var branch from 53c7069 to 1bbc521 Compare July 24, 2026 17:33
@ggallen
ggallen added this pull request to the merge queue Jul 24, 2026
Merged via the queue into main with commit 106f2e6 Jul 24, 2026
14 checks passed
@ggallen
ggallen deleted the agent/5465-init-mint-url-org-var branch July 24, 2026 17:55
@fullsend-ai-retro

fullsend-ai-retro Bot commented Jul 24, 2026

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 5:58 PM UTC · Completed 6:17 PM UTC
Commit: 1bbc521 · View workflow run →

@fullsend-ai-retro

Copy link
Copy Markdown

Retro: PR #5469 — discover mint URL from org variable for per-org repos

Timeline

Time (UTC) Event Outcome
Jul 22 14:57 Issue #5465 filed by ggallen Bug: repos init doesn't discover mint URL from org-level variable
Jul 22 14:57 Triage agent (run 29931088318) Success — correctly identified root cause, recommended fix, proposed 3 test cases
Jul 22 15:30 /fs-code triggered by ggallen Code agent dispatched
Jul 22 15:39 Code agent (run 29933697441) Success — opened PR #5469 with implementation + 3 tests
Jul 22 15:39 Review agent attempt 1 (run 29934396723) Failure — iteration 1 exited without writing output file; iteration 2 produced valid output but harness skipped post-script; cleanup crashed on permission denied
Jul 22 16:07 /fs-review triggered by ggallen Manual re-dispatch
Jul 22 16:09 Review agent attempt 2 (run 29936621700) Success — 1 medium + 2 low findings (documentation gaps, style nit)
Jul 22 16:39 /fs-fix. triggered by ggallen (period after command) No dispatchawk '{print $1}' yielded /fs-fix. which didn't match the case statement
Jul 22 16:49 /fs-fix - triggered by ggallen (correct syntax) Fix agent dispatched
Jul 22 16:50 Fix agent (run 29939682917) Success — addressed all 3 findings in one iteration (~7 min)
Jul 23 08:18 Human review by rh-hemartin Approved
Jul 24 17:55 PR merged

Assessment

The triage-to-code pipeline worked well: the triage agent accurately diagnosed the root cause and proposed test cases that the code agent implemented faithfully. The code change was well-scoped (119 additions across 4 files) and all review findings were documentation/style issues — no correctness bugs.

The review agent's findings were useful: it caught two documentation gaps and a style inconsistency that the fix agent resolved in a single 7-minute iteration. However, the pipeline required two human interventions that could have been avoided.

Existing issues with new supporting evidence

  • #2886 (review agent should guarantee output file is written before exit): Review iteration 1 on this PR exited code 0 after ~9.5 minutes of reasoning about sub-agent dispatch but never wrote output/agent-result.json.
  • #3548 (review workflow shows Failure despite valid output): Iteration 2 produced a valid approve result, but the harness marked overall validation as failed because iteration 1 had no output, skipped the post-script, and exited 1.
  • #5529 (sandbox cleanup should handle restrictive permissions): The failed review run crashed during cleanup with unlinkat /tmp/agent-review-7353-1784734843/website/.gitignore: permission denied.

Agents repo

Discovered from run logs: fullsend-ai/agents at ca518d9353f5a8363c6ba499d7a2070a1b0e7c5d.

Proposals filed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/install CLI install and app setup ready-for-review Agent PR ready for human review requires-manual-review Review requires human judgment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(repos): init should discover mint URL from org-level variables for per-org repos

2 participants